<div id="page" style="z-index: 850;">
    <?php echo form_open() ?>
    <div class="page-title">
        <div style="z-index: 830;" class="in">
            <div class="titlebar">	
                <h2><?php echo $lang['heading_title'] ?></h2>
            </div>
            <div class="button-area"><?php echo form_submit($input_submit) ?></div>
        </div>
    </div>
    <div class="content" style="z-index: 730;">
        <?php if (!empty($error)) { ?>
            <div class="albox errorbox">
                <ul>
                    <?php foreach ($error as $err) { ?>
                        <li><?php echo $err ?></li>
                    <?php } ?>
                </ul>

            </div>
        <?php } ?>
        <?php foreach ($form as $tab) { ?>
            <div class="st-form-line" style="z-index: 680;">	
                <span class="st-labeltext"><?php echo $tab['label']  ?><?php echo (!empty($tab['require']) ? '<span class=require>*</span>' : '' ) ?></span>	
                <?php $func = 'form_' . $tab['type'] ?>
                <?php if ($tab['type'] == 'radio' || $tab['type'] == 'checkbox' || $tab['type'] == 'textarea') { ?>
                    <?php foreach ($tab['value'] as $input) { ?>
                        <?php echo $func($input) ?>
                        <?php echo form_label($input['label']) ?>
                    <?php } ?>
                <?php } elseif ($tab['type'] == 'dropdown') { ?>
                    <?php foreach ($tab['value'] as $input) { ?>
                        <?php echo form_dropdown($input['name'], $input['options'], $input['selected'], $input['extra']) ?>
                    <?php } ?>
                <?php } else { ?>
                    <?php echo $func($tab['value']) ?>
                <?php } ?>

                <div class="clear" style="z-index: 670;"></div>

            </div>
        <?php } ?>

        <div id="tabs" style="z-index: 590;" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
            <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                <?php foreach ($language_tabs as $id => $language) { ?>
                    <li class="ui-state-default ui-corner-top"><a href="#language-<?php echo $id ?>"><?php echo $language ?></a></li>
                <?php } ?>
            </ul>

            <?php foreach ($language_descriptions as $id => $descriptions) { ?>
                <div id="language-<?php echo $id ?>" style="z-index: 580;" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
                    <?php foreach ($descriptions as $tab) { ?>
                        <div class="st-form-line" style="z-index: 680;">	
                            <span class="st-labeltext"><?php echo $tab['label'] ?> <?php echo (!empty($tab['require']) ? '<span class=require>*</span>' : '' ) ?></span>	
                            <?php $func = 'form_' . $tab['type'] ?>
                            <?php if ($tab['type'] == 'radio' || $tab['type'] == 'checkbox') { ?>
                                <?php foreach ($tab['value'] as $input) { ?>
                                    <?php echo $func($input) ?>
                                    <?php echo form_label($input['label']) ?>
                                <?php } ?>
                            <?php } elseif ($tab['type'] == 'dropdown') { ?>
                                <?php foreach ($tab['value'] as $input) { ?>
                                    <?php echo form_dropdown($input['name'], $input['options'], $input['selected'], $input['extra']) ?>
                                <?php } ?>
                            <?php } else { ?>
                                <?php echo $func($tab['value']) ?>
                            <?php } ?>

                            <div class="clear" style="z-index: 670;"></div>

                        </div>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
    <?php echo form_close() ?>
</div>
<!-- start tabs codes -->
<script type="text/javascript">
    $(function() {
        $( "#tabs" ).tabs();
    });
</script>